package com.bocai.freeman.view.activitys;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.Menu;
import android.widget.TextView;

import com.bocai.freeman.R;
import com.bocai.freeman.base.BaseActivity;
import com.bocai.freeman.utils.ToolbarHelper;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by admin on 2016/5/20.
 */
public class PersonalEditActivity extends BaseActivity {

    @Bind(R.id.tv_theme)
    TextView mTvTheme;
    @Bind(R.id.toolbar)
    Toolbar mToolbar;

    private String theme;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_personal_edit);
        ButterKnife.bind(this);
        initView();
        initEvent();
    }

    @Override
    protected void initEvent() {
        super.initEvent();
        theme = getIntent().getStringExtra("theme");
        ToolbarHelper.setup(this,theme,R.mipmap.left_return, v -> onBackPressed());
        mToolbar.setOnMenuItemClickListener(item -> {
            return true;
        });

        if(TextUtils.equals(theme,getString(R.string.modify_nickname))){
            mTvTheme.setText(getString(R.string.edit_nickname_prompt));
        }else if(TextUtils.equals(theme,getString(R.string.modify_name))){
            mTvTheme.setText(getString(R.string.edit_name_prompt));
        }

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_save, menu);
        return super.onCreateOptionsMenu(menu);
    }
}
